<%--
  Created by IntelliJ IDEA.
  User: Dell
  Date: 2018/4/22
  Time: 17:44
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->


    <!--引入 jQuery 文件 -->
    <script src="./jquery/jquery.min.js"></script>
    <link rel="stylesheet" href="./bootstrap/bootstrap/css/bootstrap.css">
    <script src="./bootstrap/bootstrap/js/bootstrap.js"></script><!--引入 限制登陆样式css -->
    <link href="/bootstrap/signin.css" rel="stylesheet">

    <title>网易理财</title>
    <style type="text/css">
        #testa{
            position: absolute;
            top:48%;
            left:60%;
            width: 300px;
            float: right;
        }

        .form-signin{
            position: relative;
            margin-left: 1.6%;margin-top:7%;

        }

        #ss{
            position: absolute;
            margin-left: 96%;
            margin-top: -13%;
            width:200px;
            height:30px;
            color: red;
        }
        #box{background-image:url("/photos/1.jpg");background-position:center center;background-repeat:no-repeat;background-size:cover;}

    </style>


</head>
<body id="box">


<div style="position:absolute;top:55%;left:55%;margin-left:-350px;margin-top:-263px;">
    <div class="box-detail" style="width: 500px; background: rgb(255, 255, 255);">  <!--宽高、定位层-->
        <div style="box-shadow: 0px 0px 15px #999; "> <!--背景色、边框、倒角、阴影-->
            <div style="background: #5bc0de;width:500px;height:70px;position: relative;">

                <img src="/photos/99.jpg" style="position: absolute;left:58%;top:79%;width: 81px;margin-left:-85.5px;margin-top:-51px;" alt="网易理财">
            </div>
            <div class="modal-body" style="background:#f5f5f5;padding:30px 15px;height: 300px;">



                <form id="form2" style="margin-top: 10px;">

                    <label  style="text-indent:2em;padding:0px 17px;">手机号：</label>
                    <input type="text" class="form-control " style="width: 270px" name="companyPersonPhone"  placeholder="请输入您的手机号" ><br><br>



                    <div  style="border:none;display:inline-block;color:#FBAF37;width:32%;height:38.4px;padding:10px 10px;border-radius: 5px;  text-align: center;float: left;margin-left: 22%;font-size: 13px;margin-top: -20px;" id="testa" class="ss check2" ><a  href="javascript:settime()" >动态获取验证码</a></div><br><br>



                    <label  style="text-indent:2em;padding:0px 17px;">验证码：</label>
                    <input type="text" class="form-control " style="width: 270px;margin-top: -25px;" name="meg" value="" placeholder="请输入验证码" ><br><br>





                    <input  type="button" style="border:none;background:#FBAF37;color:#fff;width:270px;padding:10px 10px;border-radius: 5px; text-align: center;margin-left: 25.7%;"  value="登录" id="loginbtn3" class="ss check2"/><br><br>



                    <a  href="/personlogin.jsp" style="border:none;display:inline-block;color:#FBAF37;width:32%;height:38.4px;padding:10px 10px;border-radius: 5px;  text-align: center;float: left;margin-left: 22%;font-size: 13px;" id="loginbtn2" class="ss check2" >返回个人登录</a><br><br>



                    <a href="/companyreg.jsp" >
                        <div style="border:none;color:#FBAF37;width:32%;padding:10px 10px;border-radius: 5px; text-align: center;float: right;margin-top: -8.65%;margin-right: 13%;font-size: 13px;" class="ss check2">
                            没有账号?去注册
                        </div>
                    </a>

                    <br>

                </form>
            </div>
        </div>
    </div>
</div>

<script>



    var countdown=60;
    function settime() {
        //ds();
        // var  i=0;
        var   time1=setInterval(function(){

            // i++;
            //alert(i)
            // if(i==4){
            clearInterval(time1)
            //}



        },1000);





        $.ajax({
            type: "Post",
            data:{companyPersonPhone:$("[name='companyPersonPhone']").val()},
            url: "http://localhost:8077/login/queryCompany",
            success: function (result) {



                var blo=eval("("+result+")");
                if(blo){

                    alert("验证码发送成功");
                    setTimeout(test,1000)

                }else{
                    alert("手机号不正确或为空");

                    $("#testa").html("<a  onclick='settime()'>动态获取验证码</a>");



                }

            }
        })

    }
    function test(){
        $("#testa").html("<div style='margin-left: 70px'><font color='red'>"+countdown--+"</font></div>")
        if( countdown>0){
            setTimeout(test,1000)
        }else{
            $("#testa").html("<a  onclick='settime()'>动态获取验证码</a>")
            countdown=60;
        }
    }











    $("#loginbtn3").click(function(){

        alert("登录成功")
        location.href="/haha.jsp"





    })



</script>


</body>
</html>
